/**
 * small-spring
 *
 * @author yuanchen
 * @date 2021-07-02 14:53
 */
package cn.bugstack.springframework.beans.factory.config;


import com.google.common.collect.Lists;

import java.util.List;

/**
 *
 * @author yuanchen
 * @date 2021-07-02 14:53
 */
public class PropertyValues {

    private final List<PropertyValue> propertyValueList= Lists.newArrayList();

    public void addPropertyValue(PropertyValue propertyValue){
        this.propertyValueList.add(propertyValue);
    }

    public List<PropertyValue> getPropertyValueList() {
        return propertyValueList;
    }

    public PropertyValue getPropertyValue(String propertyName){
        return propertyValueList.stream()
                .filter(s->s.getName().equals(propertyName))
                .findFirst().orElse(null);
    }
}
